package js;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class q杨辉2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int index = findIndex(N);
        System.out.println(index);
    }

    private static int findIndex(int N) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        int index = 1;
        if(N == 1){
            return 1;
        }
        while (true) {
            List<Integer> nextRow = new ArrayList<>();
            nextRow.add(1);
            for (int i = 0; i < list.size() - 1; i++) {
                nextRow.add(list.get(i) + list.get(i + 1));
            }
            nextRow.add(1);

            for (int i = 0; i < nextRow.size(); i++) {
                index++;
                if (nextRow.get(i) == N) {
                    return index;
                }
            }

            list = nextRow;
        }
    }
}